/**
  ******************************************************************************
  * @file    cmos.h
  * @author  mk
  * @brief   Header file of ov2640.
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __CMOS_H
#define __CMOS_H

#include <stdint.h>

#define CMOS_PHOTOBUF_MAXLEN    (32768u)

#define CMOS_CMD_QUE_LENGTH              5
#define CMOS_CMD_QUE_ITEMSIZE            sizeof(Cmos_CmdEnum)

typedef enum
{
  CMOS_CMD_START_CAPTURE  = 0x00,
  CMOS_CMD_CAPTURE_COMPLETE,
  CMOS_CMD_DCMI_ERROR,
  CMOS_CMD_DCMI_OVERRUN,
  CMOS_CMD_OVER_SIZE,
  CMOS_CMD_TRANSFER_ERROR,
}Cmos_CmdEnum;

typedef struct
{
  const uint8_t *photo;
  uint32_t photosize;
}Cmos_GetJpegPhoto;

extern const Cmos_CmdEnum Cmos_CmdStartCapture;
extern const Cmos_CmdEnum Cmos_CmdCaptureComplete;
extern const Cmos_CmdEnum Cmos_CmdDcmiError;
extern const Cmos_CmdEnum Cmos_CmdDcmiOverrun;
extern const Cmos_CmdEnum Cmos_CmdOverSize;
extern const Cmos_CmdEnum Cmos_CmdTransferError;

extern volatile uint32_t Cmos_PhotoBuf[CMOS_PHOTOBUF_MAXLEN];

#endif
